Skip to content

Document why promote() allows string <-> binary and fixed(16) -> uuid - #4410

Open
rahulsmahadev wants to merge 3 commits into
apache:mainfrom
rahulsmahadev:rahul/update-column-promotions
Open

rahulsmahadev wants to merge 3 commits into
apache:mainfrom
rahulsmahadev:rahul/update-column-promotions

Conversation

@rahulsmahadev

@rahulsmahadev rahulsmahadev commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Rationale for this change

promote() allows three type changes that aren't valid promotions in the spec: string -> binary, binary -> string and fixed(16) -> uuid. update_column() and union_by_name() use promote(), so schema updates allow them too. That's on purpose (string <-> binary was discussed in apache/iceberg#5151, and fixed(16) -> uuid is there because older PyArrow versions had no UUID type), but the code didn't say so.

This PR adds comments for these edge cases in promote() and next to its use in update_column(). No behavior change.

Are these changes tested?

Yes, added test_update_column_allows_non_spec_promotions in tests/test_schema.py. It checks that update_column() allows the three changes and still rejects fixed(15) -> uuid. test_promotion already covers promote() itself.

Are there any user-facing changes?

No.

This pull request and its description were written by Isaac.

update_column applied string <-> binary and fixed(16) -> uuid silently,
using the read-side promote(). Check the spec's promotion list instead.
Those three pairs now warn with a DeprecationWarning, and are rejected
in a later release unless allow_incompatible_changes=True is set.

Co-authored-by: Isaac <no-reply@databricks.com>
@rahulsmahadev

Copy link
Copy Markdown
Contributor Author

@geruh, could you review the compatibility transition for these previously accepted schema changes? @Anurag-S1ngh, tagging you as the latest author of table/update/schema.py in #4393. The warning cycle and the immediate-rejection alternative are in the description.

Co-authored-by: Isaac <no-reply@databricks.com>
Comment thread pyiceberg/table/update/schema.py Resolved
Comment thread pyiceberg/table/update/schema.py Resolved
Drop the deprecation: update_column keeps using promote(), the one place
for type promotions. Comment why promote() allows string <-> binary and
fixed(16) -> uuid, and test that update_column allows them.

Co-authored-by: Isaac <no-reply@databricks.com>
@rahulsmahadev rahulsmahadev changed the title Deprecate implicit non-spec type changes in update_column Document why promote() allows string <-> binary and fixed(16) -> uuid Nov 19, 2026

@Fokko Fokko left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding these comments @rahulsmahadev 👍

@Fokko
Fokko enabled auto-merge November 19, 2026 15:14
@Fokko
Fokko added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants